/*
 *  Player.h
 *  SquirrelAdven
 *
 *  Created by Wen Xu on 3/14/11.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#include <string>
#include <vector>
#include "PlayerAction.h"
#include "ItemList.h"
#include "Wm5WindowApplication3.h"

using namespace Wm5;

class Player {
protected:
	int playerID;
	std::string playerTitle;
	std::string objFilename;
	std::string wmtfFilename;

	
	TriMesh * playerMesh;
	
	//Items inventory[400];
	
	float direction;
	
	// for collision detection
	Float3 centerPoint;
	float len_x, len_y, len_z;
	float radius;
	
	// action list
	std::vector<PlayerAction> actionList;
	
	int numPoints;
	
public:
	Player();
	~Player();
	int numAcorns, numSticks, numLogs, numRope, numRocks;

	void setPlayerID(int id);
	void setObjFilename(std::string objFilename);
	void setWmtfFilename(std::string wmtfFilename);
	TriMesh * getPlayerMesh();
	std::vector<PlayerAction> getActionList();
	void addAction(PlayerAction action);
	void clearActionList();
	
	int getPlayerID();
	
	void setDirection(float d);
	float getDirection();
	
	// add/remove item to/from inventory
	void addToInventory(Items * item);
	void removeFromInventory(Items * item);
	std::string printInventory();
	
	int totalPoints();
	void addPoints(int points);
	
	void computeBoundingBox();
	
	float getOriginalLengthX();
	float getOriginalLengthY();
	float getOriginalLengthZ();
	
	// bounding cylinder
	float getRadius();
	Float3 getCenterPoint();
	void modifyRadius(APoint scale_p);
	void modifyCenterPoint(APoint translate_p);
};